﻿using UnityEngine;
using Core;

namespace Core
{
    public class DebugCoreTipSystem : EntitySystem, IAwake
    {
        public void Awake()
        {
            Subscribe<CoreTip>(OnTip);
        }

        private void OnTip(ref CoreTip tip)
        {
            switch (tip.level)
            {
                case TipLevel.Log:
                    Debug.Log(tip.message);
                    break;
                case TipLevel.Success:
                    Debug.Log($"<color=#00ff00>[SUCCESS]</color>{tip.message}");
                    break;
                case TipLevel.Warring:
                    Debug.Log($"<color=#00ffff>[WARRING]</color>{tip.message}");
                    break;
                case TipLevel.Error:
                    Debug.LogError(tip.message);
                    break;
            }
        }
    }
}

